#ifndef _SCOUT_
#define _SCOUT_

#include <iostream>

#include "aerial\Game\GameObject\FlyObject\FlyObject.h"

#include "hge\hge.h"
#include "hge\hgesprite.h"
#include "hge\hgevector.h"
#include "hge\hgeresource.h"

using namespace air;
using namespace std;

#define S_M_MOV		0x04
#define S_M_BUR		0x08
#define S_M_WIN     0x10

#define TYPE_SCOUT 0x1

/// @brief a type of aircraft
class Scout: public FlyObject
{
public:
	Scout(int id, const char* username, float x, float y, uchar side, float A = 0.f);
	~Scout();

	void render();
	bool update(float dt);
	void processInput();

	inline virtual uchar GetFlightType() {	return TYPE_SCOUT; }

	virtual void DeSerializationFull(BitStream* p);
	virtual void DeSerializationIncrement(BitStream* p);

	virtual void SerializationFull(BitStream*);
	virtual void SerializationIncrement(BitStream*);

	virtual void RegulateDeviation();
	inline virtual bool IsStateChange() 
	{
		if (d_status || (status & S_M_MOV)) {
			return true; 
		}
		return false; 
	}

	/**
	 * @brief move Scout according current status
	 *
	 * @param dt elapsed time
	 * @param flag 0 for static 1 for moving
	 */
	void move(float dt);

	/**
	 * @brief rotate Scout according current status
	 *
	 * @param dt elapsed time
	 */
	void turn(float dt);

	/// @breif handle the vulcan weapon

private:
	bool mouseMove;
	// weapon list
	hgeSprite* spr;
	// each remote pull should be divided into 10 local pulls

	float lastArmor;
	int judge;

	int lastRotate,lastCount,countDt,burstType,countDt2,winType;

	static const float SpeedPowerGen;
	static const float MaxPower;
	static const float MaxArmor;

	static const float MaxShieldRadius;
	/// @biref Scout's rad speed
	static const float RadiusPS;
	/// @brief Scout's max speed Max Pixel Per Second
	static const float MPPS;
};


#endif
